package com.fwj.authorization.staff.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fwj.authorization.staff.entity.SysUserRole;
import com.fwj.authorization.staff.mapper.SysUserRoleMapper;
import com.fwj.authorization.staff.service.SysUserRoleService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 角色用户
 *
 * @author 樊温军
 * @date 2025/3/18 上午10:32
 */
@Service
public class SysUserRoleServiceImpl extends ServiceImpl<SysUserRoleMapper, SysUserRole> implements SysUserRoleService {

    @Override
    public IPage<SysUserRole> getPage(Page<SysUserRole> page, SysUserRole sysUserRole) {
        return baseMapper.getPage(page, sysUserRole);
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public Boolean saveUserRole(List<SysUserRole> sysUserRoles) {
        return this.saveOrUpdateBatch(sysUserRoles);
    }
}
